package com.teemor.blog.service.impl;

import com.teemor.blog.entity.TbComment;
import com.teemor.blog.entity.condition.TbCommentCondition;
import com.teemor.blog.mapper.TbCommentMapper;
import com.teemor.blog.service.ICommentService;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CommentServiceImpl implements ICommentService {
    @Autowired
    private TbCommentMapper tbCommentMapper;

    public int countComment(TbCommentCondition condition) {
        return tbCommentMapper.countCommentByCondition(condition);
    }

    public List<TbComment> qryComments(TbCommentCondition condition) {
        return tbCommentMapper.selectCommentByCondition(condition);
    }

    public TbComment qryCommentById(Integer commentId) {
        return tbCommentMapper.selectCommentByCommentId(commentId);
    }

    public int addComment(TbComment inParam) {
        return tbCommentMapper.insertComment(inParam);
    }

    public int updCommentById(TbComment inParam) {
        return tbCommentMapper.updateCommentByCommentId(inParam);
    }
}